home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / utility / mu17_ext.zip / DEBUG.H < prev    next >
C/C++ Source or Header  |  1994-03-07  |  973b  |  58 lines

  1. /*
  2. **    $VER: debug.h 1.0 (07.02.94)
  3. **
  4. **    debug library header file
  5. **
  6. **    ⌐ Copyright 1994 by Norbert Pⁿschel
  7. **    All Rights Reserved
  8. */
  9.  
  10. #ifndef DEBUG_H
  11. #define DEBUG_H
  12.  
  13. #ifdef DEBUG
  14.  
  15. #include <proto/exec.h>
  16.  
  17. #pragma libcall DebugBase DEBUGA 1e 32103
  18. #pragma tagcall DebugBase DEBUG 1e 32103
  19.  
  20. #ifndef DEBUG_LOGFILE
  21. #define DEBUG_LOGFILE "t:debug.log"
  22. #endif
  23.  
  24. void DEBUGA(STRPTR fname,STRPTR format,LONG *args);
  25.  
  26. #define debug2 debug
  27. #define debug3 debug
  28. #define debug4 debug
  29. #define debug5 debug
  30. #define debug6 debug
  31. #define debug7 debug
  32.  
  33. static void debug(STRPTR format,...)
  34.  
  35. {
  36.   struct Library *DebugBase;
  37.  
  38.   DebugBase = OpenLibrary("debug.library",0);
  39.   if(DebugBase) {
  40.     DEBUGA(DEBUG_LOGFILE,format,(LONG *)(&format+1));
  41.     CloseLibrary(DebugBase);
  42.   }
  43. }
  44.  
  45. #else
  46.  
  47. #define debug(f)
  48. #define debug2(f,a1)
  49. #define debug3(f,a1,a2)
  50. #define debug4(f,a1,a2,a3)
  51. #define debug5(f,a1,a2,a3,a4)
  52. #define debug6(f,a1,a2,a3,a4,a5)
  53. #define debug7(f,a1,a2,a3,a4,a5,a6)
  54.  
  55. #endif
  56.  
  57. #endif
  58.